package com.kaishengit.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.kaishengit.pojo.Idea;
import com.kaishengit.pojo.Ideacomment;


@Repository
public class IdeacommDao extends BaseDao<Ideacomment, String>{

	public  List<Ideacomment> findByIdea(Idea idea) {
		String hql = "from Ideacomment where ideaid = :idea";
		Query query = getSession().createQuery(hql);		
		query.setParameter("idea", idea);
		
		@SuppressWarnings("unchecked")
		List<Ideacomment> ideacommList=query.list();
		return ideacommList;
	}
	
}
